package day03.practice;

import java.util.Scanner;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/4/14
 */
//打印出n行金字塔，字母版
public class Practice31 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入金字塔的行数：");
        int n = sc.nextInt();
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <=n-i; j++) {
                System.out.print(" ");
            }
            for (int k = 1; k <=2*i-1; k++) {
                System.out.print("*");
            }
            System.out.println();
        }

    }
}
